<?php

/**
 * Global helpers file with misc functions
 **/

if (!function_exists('app_name')) {
    /**
     * Helper to grab the application name
     *
     * @return mixed
     */
    function app_name()
    {
        return config('app.name');
    }
}

if (!function_exists('javascript')) {
    /**
     * Access the javascript helper
     */
    function javascript()
    {
        return app('JavaScript');
    }
}

if (!function_exists('inWeixin')) {
    /**
     * 是否在微信内
     * @return bool
     */
    function inWeixin()
    {
        $pos = stripos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger');
        if (false !== $pos) {
            return true;
        }

        return false;
    }
}